package com.ndp.fb.model.business.vo.publish.param;

import com.alibaba.fastjson.JSON;
import com.ndp.fb.enums.CallToActionType;
import com.ndp.fb.model.business.bo.targetingspec.CustomAudience;
import com.ndp.fb.model.business.vo.advertising.param.BidInfoVoParam;
import com.ndp.fb.model.business.vo.cache.result.NameAssembly;
import com.ndp.fb.model.rdb.AudienceManager;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by jacky.cheng on 2016/4/25.
 */
@Getter
@Setter
@NoArgsConstructor
public class EcPublishBatchVoParam implements Serializable {

    //推广目标
    private Long productId;
    private Long weFeedId;
    private Long fbAccountId;
    private String productSetId;

    //受众
    private Long userAudienceId;
    private List<CustomAudience> customAudiences;

    //出价
    private BidInfoVoParam bidInfo;

    //创意
    private Long ecTemplateMaterielId;
    private EcCreativeVoParam creative;

    //名称配置
    private List<NameAssembly> campaignName;
    private List<NameAssembly> adSetName;
    private List<NameAssembly> adName;
    private AudienceManager audience;
    private boolean autoCreate;
    
    private String ecMarketingActionRecordId; 
    
    private String ecAdActionRecordId;
    
    private String adMarketTargetId;
    
    private String strategyRuleSpecificId;

    private void mockJson(){
        EcPublishBatchVoParam ec=new EcPublishBatchVoParam();
        ec.productId=122789863646486L;
        ec.weFeedId=41L;
        ec.fbAccountId=1379662195604405L;
        ec.productSetId="62a9edb0-3102-4905-85aa-923f6c06ada4";
        ec.userAudienceId=2L;


        BidInfoVoParam bidInfo=new BidInfoVoParam();

        bidInfo.setStartTime("2016-05-05 11:00");
        bidInfo.setEndTime("2016-05-06 11:00");
        bidInfo.setBidAmount(1);
        bidInfo.setOptimizationGoal("LINK_CLICKS");
        bidInfo.setBillingEvent("LINK_CLICKS");
        bidInfo.setBudgetType(1);
        bidInfo.setDailyBudget(100);

        ec.bidInfo=bidInfo;
        ec.ecTemplateMaterielId=25L;
/*

        EcCreativeVoParam creative=new EcCreativeVoParam();
        List<NameAssembly> adTitle=new ArrayList<>();
        adTitle.add(new NameAssembly("","","text","this is ad title text"));
        creative.setAdTitle(adTitle);

        List<NameAssembly> adWord=new ArrayList<>();
        adWord.add(new NameAssembly("","","text","this is ad adWord text"));
        creative.setAdWord(adWord);

        List<NameAssembly> dynamicMsgLinkDesc=new ArrayList<>();
        dynamicMsgLinkDesc.add(new NameAssembly("","","text","this is ad dynamicMsgLinkDesc text"));
        creative.setDynamicMsgLinkDesc(dynamicMsgLinkDesc);
*/

        creative.setChooseType("carousel");
        creative.setLink("http://www.tianya.cn");
        creative.setLinkCaption("http://www.163.com");
        creative.setPageId(453474671373675L);
        creative.setLinkParam("kkk=123&utm=456");
        creative.setCallToActionType(CallToActionType.SHOP_NOW);

        ec.creative=creative;


        List<NameAssembly> campaignName=new ArrayList<>();
        campaignName.add(new NameAssembly("","","text","campaignTest123"));

        List<NameAssembly> adSetName=new ArrayList<>();
        adSetName.add(new NameAssembly("","","text","adSetTest123"));

        List<NameAssembly> adName=new ArrayList<>();
        adName.add(new NameAssembly("","","text","adTest123"));

        ec.campaignName=campaignName;
        ec.adSetName=adSetName;
        ec.adName=adName;

        System.out.println(JSON.toJSONString(ec));

    }

    public static void main(String[] args) {
        new EcPublishBatchVoParam().mockJson();
    }
}
